home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / game / board / Exchess.lha / EXChess / define.h < prev    next >
Text File  |  1998-09-19  |  2KB  |  78 lines

  1. /* Pre-processor definitions to make the code more
  2.    readable and easy to modify */
  3.  
  4. #define VERS  2.45              // program version number
  5. #define MAXD  46                // max search depth
  6. #define MATE 10000000           // mate score
  7.  
  8. // Compiler flags for different systems
  9. #define BORLAND  0      // Selects a win95/NT compiler if set to 1
  10.                         //   this should work with MSVC and others as
  11.                         //   well
  12. #define DEC      0      // Set to 1 for certain DEC Unix systems, not
  13.                         //   all will need it - some other unixes may
  14.                         //   need this if there are errors in "book.cpp"
  15. #define UNIX     1      // Set to 1 for all Unix systems
  16.  
  17. #define DEBUG    0      // Set to 1 to debug mode... quite slow
  18.  
  19.  
  20. // define book file
  21. #define BOOK_FILE "open_bk.dat"
  22.  
  23. // book learning threshold..
  24. #define LEARN_SCORE    500
  25. #define LEARN_FACTOR     5
  26.  
  27. // Color flags
  28. #define WHITE 1
  29. #define BLACK 0
  30.  
  31. /* Piece definitions */
  32.  
  33. #define EMPTY        0
  34. #define PAWN         1
  35. #define KNIGHT       2
  36. #define BISHOP       3
  37. #define ROOK         4
  38. #define QUEEN        5
  39. #define KING         6
  40.  
  41. /* Piece id numbers for certain kinds of indicies */
  42.  
  43. #define BPAWN        1
  44. #define BKNIGHT      2
  45. #define BBISHOP      3
  46. #define BROOK        4
  47. #define BQUEEN       5
  48. #define BKING        6
  49. #define WPAWN        7
  50. #define WKNIGHT      8
  51. #define WBISHOP      9
  52. #define WROOK       10
  53. #define WQUEEN      11
  54. #define WKING       12
  55.  
  56. /* Types of moves */
  57.  
  58. #define CAPTURE      1
  59. #define CASTLE       2
  60. #define EP           4
  61. #define PAWN_PUSH2   8
  62. #define PAWN_PUSH   16
  63. #define PROMOTE     32
  64.  
  65. /* macros */
  66. #define RANK(x)    ((x)>>3)        // Find the rank associated with square x
  67. #define FILE(x)    ((x)&7)         // Find the file associated with square x
  68. #define SQR(x,y)   ((x)+8*(y))       // Find square from rank x and file y
  69.  
  70. #define CHAR_FILE(x) (int(x)-97)  // convert letter character to a file
  71. #define CHAR_ROW(x)  (int(x)-49)  // convert number character to a row
  72.  
  73. // find the id number of the piece
  74. #define ID(x) (((x.side) > 0) ? ((x.type)+6) : (x.type) )
  75.  
  76. #define NOMOVE       0           // no move
  77.  
  78.